<%--
  Created by IntelliJ IDEA.
  User: 王琛
  Date: 2021/7/20
  Time: 11:15
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>拍卖行</title>
</head>
<body>
<form id="form">
    <input name="id" type="hidden" value="${message.id}">
    <input name="price" type="text" value="${message.price}"> 一口价
    <input name="currentPrice" type="text" value="${message.currentPrice}">竞拍价
    <input type="button" onclick="edit()" value="修改">
    <input type="reset" value="取消">
</form>
<script src="<%=request.getContextPath()%>/resources/js/jquery-3.1.1.js"></script>
<script>
  function  edit() {
    $.ajax({
      //这个地址
      "url":"<%=request.getContextPath()%>/auction/edit",
      //这种方式
      "type":"post",
      //传递这样的数据
      "data":$('form').serialize(),
      "dataType":"json",
      "success":function (data){
        if(data.code==200){
          alert("修改成功");
          window.location.href="http://localhost:8080/ssm/auction/list";
        }
        console.log(data);
      },
      "error":function (a,b,c) {
        console.log(a);
        console.log(b);
        console.log(c);
      }
    });
  }
</script>
</body>
<script>
</script>
</html>
